package us.x.slowexp.dao.impl;


import java.io.Serializable;
import java.util.List;

import org.springframework.stereotype.Repository;

import us.x.slowexp.dao.ExpressDao;
import us.x.slowexp.domain.Express;

@Repository
public class ExpressDaoImpl extends BaseDaoImpl<Express> implements ExpressDao {
	public ExpressDaoImpl(){
		this.setNs("us.x.slowexp.mapper.domain.express.");
	}

	public String queryMaxNo() {
		return (String) this.getSqlSession().selectOne(this.getNs() + "queryMaxNo");
	}

	public Express findById(Serializable expressNo) {
		return (Express) this.getSqlSession().selectOne(this.getNs() + "findById", expressNo);
	}

	public List<Express> findFinishedExpress() {
		return this.getSqlSession().selectList(this.getNs() + "findFinishedExpress");
	}

	public int queryUnfinishedCount() {
		return (Integer) this.getSqlSession().selectOne(this.getNs() + "queryUnfinishedCount");
	}

	public List<Express> queryHistoryExpress() {
		return this.getSqlSession().selectList(this.getNs() + "queryHistoryExpress");
	}

	public void add2HistoryExpress(Express express) {
		this.getSqlSession().insert(this.getNs() + "insert2HistoryExpress", express);
	}
}
